<?php
	/**
	 * This is a MetaControl class, providing a QForm or QPanel access to event handlers
	 * and QControls to perform the Create, Edit, and Delete functionality
	 * of the TableBank class.  This code-generated class
	 * contains all the basic elements to help a QPanel or QForm display an HTML form that can
	 * manipulate a single TableBank object.
	 *
	 * To take advantage of some (or all) of these control objects, you
	 * must create a new QForm or QPanel which instantiates a TableBankMetaControl
	 * class.
	 *
	 * Any and all changes to this file will be overwritten with any subsequent
	 * code re-generation.
	 * 
	 * @package My Application
	 * @subpackage MetaControls
	 * property-read TableBank $TableBank the actual TableBank data class being edited
	 * property QLabel $IdControl
	 * property-read QLabel $IdLabel
	 * property QListBox $UserIdControl
	 * property-read QLabel $UserIdLabel
	 * property QTextBox $CountryNameControl
	 * property-read QLabel $CountryNameLabel
	 * property QTextBox $CountryCodeControl
	 * property-read QLabel $CountryCodeLabel
	 * property QTextBox $BranchNameControl
	 * property-read QLabel $BranchNameLabel
	 * property QTextBox $BranchCodeControl
	 * property-read QLabel $BranchCodeLabel
	 * property QTextBox $BankNameControl
	 * property-read QLabel $BankNameLabel
	 * property QTextBox $BankCodeControl
	 * property-read QLabel $BankCodeLabel
	 * property QTextBox $AccountNameControl
	 * property-read QLabel $AccountNameLabel
	 * property QTextBox $AccountIdControl
	 * property-read QLabel $AccountIdLabel
	 * property QTextBox $AccountTypeControl
	 * property-read QLabel $AccountTypeLabel
	 * property QIntegerTextBox $StatusControl
	 * property-read QLabel $StatusLabel
	 * property QTextBox $ActiveControl
	 * property-read QLabel $ActiveLabel
	 * property QTextBox $AuthCodeControl
	 * property-read QLabel $AuthCodeLabel
	 * property QDateTimePicker $AuthDateControl
	 * property-read QLabel $AuthDateLabel
	 * property QDateTimePicker $CreateDateControl
	 * property-read QLabel $CreateDateLabel
	 * property QTextBox $AccountNameKanaControl
	 * property-read QLabel $AccountNameKanaLabel
	 * property QTextBox $IpControl
	 * property-read QLabel $IpLabel
	 * property QIntegerTextBox $TypeControl
	 * property-read QLabel $TypeLabel
	 * property-read string $TitleVerb a verb indicating whether or not this is being edited or created
	 * property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
	 */

	class TableBankMetaControlGen extends QBaseClass {
		// General Variables
		protected $objTableBank;
		protected $objParentObject;
		protected $strTitleVerb;
		protected $blnEditMode;

		// Controls that allow the editing of TableBank's individual data fields
		protected $lblId;
		protected $lstUser;
		protected $txtCountryName;
		protected $txtCountryCode;
		protected $txtBranchName;
		protected $txtBranchCode;
		protected $txtBankName;
		protected $txtBankCode;
		protected $txtAccountName;
		protected $txtAccountId;
		protected $txtAccountType;
		protected $txtStatus;
		protected $txtActive;
		protected $txtAuthCode;
		protected $calAuthDate;
		protected $calCreateDate;
		protected $txtAccountNameKana;
		protected $txtIp;
		protected $txtType;

		// Controls that allow the viewing of TableBank's individual data fields
		protected $lblUserId;
		protected $lblCountryName;
		protected $lblCountryCode;
		protected $lblBranchName;
		protected $lblBranchCode;
		protected $lblBankName;
		protected $lblBankCode;
		protected $lblAccountName;
		protected $lblAccountId;
		protected $lblAccountType;
		protected $lblStatus;
		protected $lblActive;
		protected $lblAuthCode;
		protected $lblAuthDate;
		protected $lblCreateDate;
		protected $lblAccountNameKana;
		protected $lblIp;
		protected $lblType;

		// QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References

		// QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References


		/**
		 * Main constructor.  Constructor OR static create methods are designed to be called in either
		 * a parent QPanel or the main QForm when wanting to create a
		 * TableBankMetaControl to edit a single TableBank object within the
		 * QPanel or QForm.
		 *
		 * This constructor takes in a single TableBank object, while any of the static
		 * create methods below can be used to construct based off of individual PK ID(s).
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableBankMetaControl
		 * @param TableBank $objTableBank new or existing TableBank object
		 */
		 public function __construct($objParentObject, TableBank $objTableBank) {
			// Setup Parent Object (e.g. QForm or QPanel which will be using this TableBankMetaControl)
			$this->objParentObject = $objParentObject;

			// Setup linked TableBank object
			$this->objTableBank = $objTableBank;

			// Figure out if we're Editing or Creating New
			if ($this->objTableBank->__Restored) {
				$this->strTitleVerb = QApplication::Translate('Edit');
				$this->blnEditMode = true;
			} else {
				$this->strTitleVerb = QApplication::Translate('Create');
				$this->blnEditMode = false;
			}
		 }

		/**
		 * Static Helper Method to Create using PK arguments
		 * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
		 * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
		 * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to 
		 * edit, or if we are also allowed to create a new one, etc.
		 * 
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableBankMetaControl
		 * @param integer $intId primary key value
		 * @param QMetaControlCreateType $intCreateType rules governing TableBank object creation - defaults to CreateOrEdit
 		 * @return TableBankMetaControl
		 */
		public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			// Attempt to Load from PK Arguments
			if (strlen($intId)) {
				$objTableBank = TableBank::Load($intId);

				// TableBank was found -- return it!
				if ($objTableBank)
					return new TableBankMetaControl($objParentObject, $objTableBank);

				// If CreateOnRecordNotFound not specified, throw an exception
				else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
					throw new QCallerException('Could not find a TableBank object with PK arguments: ' . $intId);

			// If EditOnly is specified, throw an exception
			} else if ($intCreateType == QMetaControlCreateType::EditOnly)
				throw new QCallerException('No PK arguments specified');

			// If we are here, then we need to create a new record
			return new TableBankMetaControl($objParentObject, new TableBank());
		}

		/**
		 * Static Helper Method to Create using PathInfo arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableBankMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableBank object creation - defaults to CreateOrEdit
		 * @return TableBankMetaControl
		 */
		public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::PathInfo(0);
			return TableBankMetaControl::Create($objParentObject, $intId, $intCreateType);
		}

		/**
		 * Static Helper Method to Create using QueryString arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableBankMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableBank object creation - defaults to CreateOrEdit
		 * @return TableBankMetaControl
		 */
		public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::QueryString('intId');
			return TableBankMetaControl::Create($objParentObject, $intId, $intCreateType);
		}



		///////////////////////////////////////////////
		// PUBLIC CREATE and REFRESH METHODS
		///////////////////////////////////////////////

		/**
		 * Create and setup QLabel lblId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblId_Create($strControlId = null) {
			$this->lblId = new QLabel($this->objParentObject, $strControlId);
			$this->lblId->Name = QApplication::Translate('Id');
			if ($this->blnEditMode)
				$this->lblId->Text = $this->objTableBank->Id;
			else
				$this->lblId->Text = 'N/A';
			return $this->lblId;
		}

		/**
		 * Create and setup QListBox lstUser
		 * @param string $strControlId optional ControlId to use
		 * @return QListBox
		 */
		public function lstUser_Create($strControlId = null) {
			$this->lstUser = new QListBox($this->objParentObject, $strControlId);
			$this->lstUser->Name = QApplication::Translate('User');
			$this->lstUser->Required = true;
			if (!$this->blnEditMode)
				$this->lstUser->AddItem(QApplication::Translate('- Select One -'), null);
			$objUserArray = TableUserProject::LoadAll();
			if ($objUserArray) foreach ($objUserArray as $objUser) {
				$objListItem = new QListItem($objUser->__toString(), $objUser->Id);
				if (($this->objTableBank->User) && ($this->objTableBank->User->Id == $objUser->Id))
					$objListItem->Selected = true;
				$this->lstUser->AddItem($objListItem);
			}
			return $this->lstUser;
		}

		/**
		 * Create and setup QLabel lblUserId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblUserId_Create($strControlId = null) {
			$this->lblUserId = new QLabel($this->objParentObject, $strControlId);
			$this->lblUserId->Name = QApplication::Translate('User');
			$this->lblUserId->Text = ($this->objTableBank->User) ? $this->objTableBank->User->__toString() : null;
			$this->lblUserId->Required = true;
			return $this->lblUserId;
		}

		/**
		 * Create and setup QTextBox txtCountryName
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtCountryName_Create($strControlId = null) {
			$this->txtCountryName = new QTextBox($this->objParentObject, $strControlId);
			$this->txtCountryName->Name = QApplication::Translate('Country Name');
			$this->txtCountryName->Text = $this->objTableBank->CountryName;
			$this->txtCountryName->MaxLength = TableBank::CountryNameMaxLength;
			return $this->txtCountryName;
		}

		/**
		 * Create and setup QLabel lblCountryName
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblCountryName_Create($strControlId = null) {
			$this->lblCountryName = new QLabel($this->objParentObject, $strControlId);
			$this->lblCountryName->Name = QApplication::Translate('Country Name');
			$this->lblCountryName->Text = $this->objTableBank->CountryName;
			return $this->lblCountryName;
		}

		/**
		 * Create and setup QTextBox txtCountryCode
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtCountryCode_Create($strControlId = null) {
			$this->txtCountryCode = new QTextBox($this->objParentObject, $strControlId);
			$this->txtCountryCode->Name = QApplication::Translate('Country Code');
			$this->txtCountryCode->Text = $this->objTableBank->CountryCode;
			$this->txtCountryCode->MaxLength = TableBank::CountryCodeMaxLength;
			return $this->txtCountryCode;
		}

		/**
		 * Create and setup QLabel lblCountryCode
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblCountryCode_Create($strControlId = null) {
			$this->lblCountryCode = new QLabel($this->objParentObject, $strControlId);
			$this->lblCountryCode->Name = QApplication::Translate('Country Code');
			$this->lblCountryCode->Text = $this->objTableBank->CountryCode;
			return $this->lblCountryCode;
		}

		/**
		 * Create and setup QTextBox txtBranchName
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtBranchName_Create($strControlId = null) {
			$this->txtBranchName = new QTextBox($this->objParentObject, $strControlId);
			$this->txtBranchName->Name = QApplication::Translate('Branch Name');
			$this->txtBranchName->Text = $this->objTableBank->BranchName;
			$this->txtBranchName->Required = true;
			$this->txtBranchName->MaxLength = TableBank::BranchNameMaxLength;
			return $this->txtBranchName;
		}

		/**
		 * Create and setup QLabel lblBranchName
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblBranchName_Create($strControlId = null) {
			$this->lblBranchName = new QLabel($this->objParentObject, $strControlId);
			$this->lblBranchName->Name = QApplication::Translate('Branch Name');
			$this->lblBranchName->Text = $this->objTableBank->BranchName;
			$this->lblBranchName->Required = true;
			return $this->lblBranchName;
		}

		/**
		 * Create and setup QTextBox txtBranchCode
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtBranchCode_Create($strControlId = null) {
			$this->txtBranchCode = new QTextBox($this->objParentObject, $strControlId);
			$this->txtBranchCode->Name = QApplication::Translate('Branch Code');
			$this->txtBranchCode->Text = $this->objTableBank->BranchCode;
			$this->txtBranchCode->Required = true;
			$this->txtBranchCode->MaxLength = TableBank::BranchCodeMaxLength;
			return $this->txtBranchCode;
		}

		/**
		 * Create and setup QLabel lblBranchCode
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblBranchCode_Create($strControlId = null) {
			$this->lblBranchCode = new QLabel($this->objParentObject, $strControlId);
			$this->lblBranchCode->Name = QApplication::Translate('Branch Code');
			$this->lblBranchCode->Text = $this->objTableBank->BranchCode;
			$this->lblBranchCode->Required = true;
			return $this->lblBranchCode;
		}

		/**
		 * Create and setup QTextBox txtBankName
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtBankName_Create($strControlId = null) {
			$this->txtBankName = new QTextBox($this->objParentObject, $strControlId);
			$this->txtBankName->Name = QApplication::Translate('Bank Name');
			$this->txtBankName->Text = $this->objTableBank->BankName;
			$this->txtBankName->Required = true;
			$this->txtBankName->MaxLength = TableBank::BankNameMaxLength;
			return $this->txtBankName;
		}

		/**
		 * Create and setup QLabel lblBankName
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblBankName_Create($strControlId = null) {
			$this->lblBankName = new QLabel($this->objParentObject, $strControlId);
			$this->lblBankName->Name = QApplication::Translate('Bank Name');
			$this->lblBankName->Text = $this->objTableBank->BankName;
			$this->lblBankName->Required = true;
			return $this->lblBankName;
		}

		/**
		 * Create and setup QTextBox txtBankCode
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtBankCode_Create($strControlId = null) {
			$this->txtBankCode = new QTextBox($this->objParentObject, $strControlId);
			$this->txtBankCode->Name = QApplication::Translate('Bank Code');
			$this->txtBankCode->Text = $this->objTableBank->BankCode;
			$this->txtBankCode->Required = true;
			$this->txtBankCode->MaxLength = TableBank::BankCodeMaxLength;
			return $this->txtBankCode;
		}

		/**
		 * Create and setup QLabel lblBankCode
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblBankCode_Create($strControlId = null) {
			$this->lblBankCode = new QLabel($this->objParentObject, $strControlId);
			$this->lblBankCode->Name = QApplication::Translate('Bank Code');
			$this->lblBankCode->Text = $this->objTableBank->BankCode;
			$this->lblBankCode->Required = true;
			return $this->lblBankCode;
		}

		/**
		 * Create and setup QTextBox txtAccountName
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtAccountName_Create($strControlId = null) {
			$this->txtAccountName = new QTextBox($this->objParentObject, $strControlId);
			$this->txtAccountName->Name = QApplication::Translate('Account Name');
			$this->txtAccountName->Text = $this->objTableBank->AccountName;
			$this->txtAccountName->Required = true;
			$this->txtAccountName->MaxLength = TableBank::AccountNameMaxLength;
			return $this->txtAccountName;
		}

		/**
		 * Create and setup QLabel lblAccountName
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblAccountName_Create($strControlId = null) {
			$this->lblAccountName = new QLabel($this->objParentObject, $strControlId);
			$this->lblAccountName->Name = QApplication::Translate('Account Name');
			$this->lblAccountName->Text = $this->objTableBank->AccountName;
			$this->lblAccountName->Required = true;
			return $this->lblAccountName;
		}

		/**
		 * Create and setup QTextBox txtAccountId
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtAccountId_Create($strControlId = null) {
			$this->txtAccountId = new QTextBox($this->objParentObject, $strControlId);
			$this->txtAccountId->Name = QApplication::Translate('Account Id');
			$this->txtAccountId->Text = $this->objTableBank->AccountId;
			$this->txtAccountId->Required = true;
			$this->txtAccountId->MaxLength = TableBank::AccountIdMaxLength;
			return $this->txtAccountId;
		}

		/**
		 * Create and setup QLabel lblAccountId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblAccountId_Create($strControlId = null) {
			$this->lblAccountId = new QLabel($this->objParentObject, $strControlId);
			$this->lblAccountId->Name = QApplication::Translate('Account Id');
			$this->lblAccountId->Text = $this->objTableBank->AccountId;
			$this->lblAccountId->Required = true;
			return $this->lblAccountId;
		}

		/**
		 * Create and setup QTextBox txtAccountType
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtAccountType_Create($strControlId = null) {
			$this->txtAccountType = new QTextBox($this->objParentObject, $strControlId);
			$this->txtAccountType->Name = QApplication::Translate('Account Type');
			$this->txtAccountType->Text = $this->objTableBank->AccountType;
			$this->txtAccountType->Required = true;
			$this->txtAccountType->MaxLength = TableBank::AccountTypeMaxLength;
			return $this->txtAccountType;
		}

		/**
		 * Create and setup QLabel lblAccountType
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblAccountType_Create($strControlId = null) {
			$this->lblAccountType = new QLabel($this->objParentObject, $strControlId);
			$this->lblAccountType->Name = QApplication::Translate('Account Type');
			$this->lblAccountType->Text = $this->objTableBank->AccountType;
			$this->lblAccountType->Required = true;
			return $this->lblAccountType;
		}

		/**
		 * Create and setup QIntegerTextBox txtStatus
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtStatus_Create($strControlId = null) {
			$this->txtStatus = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtStatus->Name = QApplication::Translate('Status');
			$this->txtStatus->Text = $this->objTableBank->Status;
			$this->txtStatus->Required = true;
			return $this->txtStatus;
		}

		/**
		 * Create and setup QLabel lblStatus
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblStatus_Create($strControlId = null, $strFormat = null) {
			$this->lblStatus = new QLabel($this->objParentObject, $strControlId);
			$this->lblStatus->Name = QApplication::Translate('Status');
			$this->lblStatus->Text = $this->objTableBank->Status;
			$this->lblStatus->Required = true;
			$this->lblStatus->Format = $strFormat;
			return $this->lblStatus;
		}

		/**
		 * Create and setup QTextBox txtActive
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtActive_Create($strControlId = null) {
			$this->txtActive = new QTextBox($this->objParentObject, $strControlId);
			$this->txtActive->Name = QApplication::Translate('Active');
			$this->txtActive->Text = $this->objTableBank->Active;
			$this->txtActive->Required = true;
			$this->txtActive->MaxLength = TableBank::ActiveMaxLength;
			return $this->txtActive;
		}

		/**
		 * Create and setup QLabel lblActive
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblActive_Create($strControlId = null) {
			$this->lblActive = new QLabel($this->objParentObject, $strControlId);
			$this->lblActive->Name = QApplication::Translate('Active');
			$this->lblActive->Text = $this->objTableBank->Active;
			$this->lblActive->Required = true;
			return $this->lblActive;
		}

		/**
		 * Create and setup QTextBox txtAuthCode
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtAuthCode_Create($strControlId = null) {
			$this->txtAuthCode = new QTextBox($this->objParentObject, $strControlId);
			$this->txtAuthCode->Name = QApplication::Translate('Auth Code');
			$this->txtAuthCode->Text = $this->objTableBank->AuthCode;
			$this->txtAuthCode->MaxLength = TableBank::AuthCodeMaxLength;
			return $this->txtAuthCode;
		}

		/**
		 * Create and setup QLabel lblAuthCode
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblAuthCode_Create($strControlId = null) {
			$this->lblAuthCode = new QLabel($this->objParentObject, $strControlId);
			$this->lblAuthCode->Name = QApplication::Translate('Auth Code');
			$this->lblAuthCode->Text = $this->objTableBank->AuthCode;
			return $this->lblAuthCode;
		}

		/**
		 * Create and setup QDateTimePicker calAuthDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calAuthDate_Create($strControlId = null) {
			$this->calAuthDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calAuthDate->Name = QApplication::Translate('Auth Date');
			$this->calAuthDate->DateTime = $this->objTableBank->AuthDate;
			$this->calAuthDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calAuthDate;
		}

		/**
		 * Create and setup QLabel lblAuthDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblAuthDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblAuthDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblAuthDate->Name = QApplication::Translate('Auth Date');
			$this->strAuthDateDateTimeFormat = $strDateTimeFormat;
			$this->lblAuthDate->Text = sprintf($this->objTableBank->AuthDate) ? $this->objTableBank->AuthDate->__toString($this->strAuthDateDateTimeFormat) : null;
			return $this->lblAuthDate;
		}

		protected $strAuthDateDateTimeFormat;


		/**
		 * Create and setup QDateTimePicker calCreateDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calCreateDate_Create($strControlId = null) {
			$this->calCreateDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calCreateDate->Name = QApplication::Translate('Create Date');
			$this->calCreateDate->DateTime = $this->objTableBank->CreateDate;
			$this->calCreateDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calCreateDate;
		}

		/**
		 * Create and setup QLabel lblCreateDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblCreateDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblCreateDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblCreateDate->Name = QApplication::Translate('Create Date');
			$this->strCreateDateDateTimeFormat = $strDateTimeFormat;
			$this->lblCreateDate->Text = sprintf($this->objTableBank->CreateDate) ? $this->objTableBank->CreateDate->__toString($this->strCreateDateDateTimeFormat) : null;
			return $this->lblCreateDate;
		}

		protected $strCreateDateDateTimeFormat;


		/**
		 * Create and setup QTextBox txtAccountNameKana
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtAccountNameKana_Create($strControlId = null) {
			$this->txtAccountNameKana = new QTextBox($this->objParentObject, $strControlId);
			$this->txtAccountNameKana->Name = QApplication::Translate('Account Name Kana');
			$this->txtAccountNameKana->Text = $this->objTableBank->AccountNameKana;
			$this->txtAccountNameKana->Required = true;
			$this->txtAccountNameKana->MaxLength = TableBank::AccountNameKanaMaxLength;
			return $this->txtAccountNameKana;
		}

		/**
		 * Create and setup QLabel lblAccountNameKana
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblAccountNameKana_Create($strControlId = null) {
			$this->lblAccountNameKana = new QLabel($this->objParentObject, $strControlId);
			$this->lblAccountNameKana->Name = QApplication::Translate('Account Name Kana');
			$this->lblAccountNameKana->Text = $this->objTableBank->AccountNameKana;
			$this->lblAccountNameKana->Required = true;
			return $this->lblAccountNameKana;
		}

		/**
		 * Create and setup QTextBox txtIp
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtIp_Create($strControlId = null) {
			$this->txtIp = new QTextBox($this->objParentObject, $strControlId);
			$this->txtIp->Name = QApplication::Translate('Ip');
			$this->txtIp->Text = $this->objTableBank->Ip;
			$this->txtIp->MaxLength = TableBank::IpMaxLength;
			return $this->txtIp;
		}

		/**
		 * Create and setup QLabel lblIp
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblIp_Create($strControlId = null) {
			$this->lblIp = new QLabel($this->objParentObject, $strControlId);
			$this->lblIp->Name = QApplication::Translate('Ip');
			$this->lblIp->Text = $this->objTableBank->Ip;
			return $this->lblIp;
		}

		/**
		 * Create and setup QIntegerTextBox txtType
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtType_Create($strControlId = null) {
			$this->txtType = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtType->Name = QApplication::Translate('Type');
			$this->txtType->Text = $this->objTableBank->Type;
			return $this->txtType;
		}

		/**
		 * Create and setup QLabel lblType
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblType_Create($strControlId = null, $strFormat = null) {
			$this->lblType = new QLabel($this->objParentObject, $strControlId);
			$this->lblType->Name = QApplication::Translate('Type');
			$this->lblType->Text = $this->objTableBank->Type;
			$this->lblType->Format = $strFormat;
			return $this->lblType;
		}



		/**
		 * Refresh this MetaControl with Data from the local TableBank object.
		 * @param boolean $blnReload reload TableBank from the database
		 * @return void
		 */
		public function Refresh($blnReload = false) {
			if ($blnReload)
				$this->objTableBank->Reload();

			if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objTableBank->Id;

			if ($this->lstUser) {
					$this->lstUser->RemoveAllItems();
				if (!$this->blnEditMode)
					$this->lstUser->AddItem(QApplication::Translate('- Select One -'), null);
				$objUserArray = TableUserProject::LoadAll();
				if ($objUserArray) foreach ($objUserArray as $objUser) {
					$objListItem = new QListItem($objUser->__toString(), $objUser->Id);
					if (($this->objTableBank->User) && ($this->objTableBank->User->Id == $objUser->Id))
						$objListItem->Selected = true;
					$this->lstUser->AddItem($objListItem);
				}
			}
			if ($this->lblUserId) $this->lblUserId->Text = ($this->objTableBank->User) ? $this->objTableBank->User->__toString() : null;

			if ($this->txtCountryName) $this->txtCountryName->Text = $this->objTableBank->CountryName;
			if ($this->lblCountryName) $this->lblCountryName->Text = $this->objTableBank->CountryName;

			if ($this->txtCountryCode) $this->txtCountryCode->Text = $this->objTableBank->CountryCode;
			if ($this->lblCountryCode) $this->lblCountryCode->Text = $this->objTableBank->CountryCode;

			if ($this->txtBranchName) $this->txtBranchName->Text = $this->objTableBank->BranchName;
			if ($this->lblBranchName) $this->lblBranchName->Text = $this->objTableBank->BranchName;

			if ($this->txtBranchCode) $this->txtBranchCode->Text = $this->objTableBank->BranchCode;
			if ($this->lblBranchCode) $this->lblBranchCode->Text = $this->objTableBank->BranchCode;

			if ($this->txtBankName) $this->txtBankName->Text = $this->objTableBank->BankName;
			if ($this->lblBankName) $this->lblBankName->Text = $this->objTableBank->BankName;

			if ($this->txtBankCode) $this->txtBankCode->Text = $this->objTableBank->BankCode;
			if ($this->lblBankCode) $this->lblBankCode->Text = $this->objTableBank->BankCode;

			if ($this->txtAccountName) $this->txtAccountName->Text = $this->objTableBank->AccountName;
			if ($this->lblAccountName) $this->lblAccountName->Text = $this->objTableBank->AccountName;

			if ($this->txtAccountId) $this->txtAccountId->Text = $this->objTableBank->AccountId;
			if ($this->lblAccountId) $this->lblAccountId->Text = $this->objTableBank->AccountId;

			if ($this->txtAccountType) $this->txtAccountType->Text = $this->objTableBank->AccountType;
			if ($this->lblAccountType) $this->lblAccountType->Text = $this->objTableBank->AccountType;

			if ($this->txtStatus) $this->txtStatus->Text = $this->objTableBank->Status;
			if ($this->lblStatus) $this->lblStatus->Text = $this->objTableBank->Status;

			if ($this->txtActive) $this->txtActive->Text = $this->objTableBank->Active;
			if ($this->lblActive) $this->lblActive->Text = $this->objTableBank->Active;

			if ($this->txtAuthCode) $this->txtAuthCode->Text = $this->objTableBank->AuthCode;
			if ($this->lblAuthCode) $this->lblAuthCode->Text = $this->objTableBank->AuthCode;

			if ($this->calAuthDate) $this->calAuthDate->DateTime = $this->objTableBank->AuthDate;
			if ($this->lblAuthDate) $this->lblAuthDate->Text = sprintf($this->objTableBank->AuthDate) ? $this->objTableBank->AuthDate->__toString($this->strAuthDateDateTimeFormat) : null;

			if ($this->calCreateDate) $this->calCreateDate->DateTime = $this->objTableBank->CreateDate;
			if ($this->lblCreateDate) $this->lblCreateDate->Text = sprintf($this->objTableBank->CreateDate) ? $this->objTableBank->CreateDate->__toString($this->strCreateDateDateTimeFormat) : null;

			if ($this->txtAccountNameKana) $this->txtAccountNameKana->Text = $this->objTableBank->AccountNameKana;
			if ($this->lblAccountNameKana) $this->lblAccountNameKana->Text = $this->objTableBank->AccountNameKana;

			if ($this->txtIp) $this->txtIp->Text = $this->objTableBank->Ip;
			if ($this->lblIp) $this->lblIp->Text = $this->objTableBank->Ip;

			if ($this->txtType) $this->txtType->Text = $this->objTableBank->Type;
			if ($this->lblType) $this->lblType->Text = $this->objTableBank->Type;

		}



		///////////////////////////////////////////////
		// PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
		///////////////////////////////////////////////





		///////////////////////////////////////////////
		// PUBLIC TABLEBANK OBJECT MANIPULATORS
		///////////////////////////////////////////////

		/**
		 * This will save this object's TableBank instance,
		 * updating only the fields which have had a control created for it.
		 */
		public function SaveTableBank() {
			try {
				// Update any fields for controls that have been created
				if ($this->lstUser) $this->objTableBank->UserId = $this->lstUser->SelectedValue;
				if ($this->txtCountryName) $this->objTableBank->CountryName = $this->txtCountryName->Text;
				if ($this->txtCountryCode) $this->objTableBank->CountryCode = $this->txtCountryCode->Text;
				if ($this->txtBranchName) $this->objTableBank->BranchName = $this->txtBranchName->Text;
				if ($this->txtBranchCode) $this->objTableBank->BranchCode = $this->txtBranchCode->Text;
				if ($this->txtBankName) $this->objTableBank->BankName = $this->txtBankName->Text;
				if ($this->txtBankCode) $this->objTableBank->BankCode = $this->txtBankCode->Text;
				if ($this->txtAccountName) $this->objTableBank->AccountName = $this->txtAccountName->Text;
				if ($this->txtAccountId) $this->objTableBank->AccountId = $this->txtAccountId->Text;
				if ($this->txtAccountType) $this->objTableBank->AccountType = $this->txtAccountType->Text;
				if ($this->txtStatus) $this->objTableBank->Status = $this->txtStatus->Text;
				if ($this->txtActive) $this->objTableBank->Active = $this->txtActive->Text;
				if ($this->txtAuthCode) $this->objTableBank->AuthCode = $this->txtAuthCode->Text;
				if ($this->calAuthDate) $this->objTableBank->AuthDate = $this->calAuthDate->DateTime;
				if ($this->calCreateDate) $this->objTableBank->CreateDate = $this->calCreateDate->DateTime;
				if ($this->txtAccountNameKana) $this->objTableBank->AccountNameKana = $this->txtAccountNameKana->Text;
				if ($this->txtIp) $this->objTableBank->Ip = $this->txtIp->Text;
				if ($this->txtType) $this->objTableBank->Type = $this->txtType->Text;

				// Update any UniqueReverseReferences (if any) for controls that have been created for it

				// Save the TableBank object
				$this->objTableBank->Save();

				// Finally, update any ManyToManyReferences (if any)
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * This will DELETE this object's TableBank instance from the database.
		 * It will also unassociate itself from any ManyToManyReferences.
		 */
		public function DeleteTableBank() {
			$this->objTableBank->Delete();
		}		



		///////////////////////////////////////////////
		// PUBLIC GETTERS and SETTERS
		///////////////////////////////////////////////

		/**
		 * Override method to perform a property "Get"
		 * This will get the value of $strName
		 *
		 * @param string $strName Name of the property to get
		 * @return mixed
		 */
		public function __get($strName) {
			switch ($strName) {
				// General MetaControlVariables
				case 'TableBank': return $this->objTableBank;
				case 'TitleVerb': return $this->strTitleVerb;
				case 'EditMode': return $this->blnEditMode;

				// Controls that point to TableBank fields -- will be created dynamically if not yet created
				case 'IdControl':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'IdLabel':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'UserIdControl':
					if (!$this->lstUser) return $this->lstUser_Create();
					return $this->lstUser;
				case 'UserIdLabel':
					if (!$this->lblUserId) return $this->lblUserId_Create();
					return $this->lblUserId;
				case 'CountryNameControl':
					if (!$this->txtCountryName) return $this->txtCountryName_Create();
					return $this->txtCountryName;
				case 'CountryNameLabel':
					if (!$this->lblCountryName) return $this->lblCountryName_Create();
					return $this->lblCountryName;
				case 'CountryCodeControl':
					if (!$this->txtCountryCode) return $this->txtCountryCode_Create();
					return $this->txtCountryCode;
				case 'CountryCodeLabel':
					if (!$this->lblCountryCode) return $this->lblCountryCode_Create();
					return $this->lblCountryCode;
				case 'BranchNameControl':
					if (!$this->txtBranchName) return $this->txtBranchName_Create();
					return $this->txtBranchName;
				case 'BranchNameLabel':
					if (!$this->lblBranchName) return $this->lblBranchName_Create();
					return $this->lblBranchName;
				case 'BranchCodeControl':
					if (!$this->txtBranchCode) return $this->txtBranchCode_Create();
					return $this->txtBranchCode;
				case 'BranchCodeLabel':
					if (!$this->lblBranchCode) return $this->lblBranchCode_Create();
					return $this->lblBranchCode;
				case 'BankNameControl':
					if (!$this->txtBankName) return $this->txtBankName_Create();
					return $this->txtBankName;
				case 'BankNameLabel':
					if (!$this->lblBankName) return $this->lblBankName_Create();
					return $this->lblBankName;
				case 'BankCodeControl':
					if (!$this->txtBankCode) return $this->txtBankCode_Create();
					return $this->txtBankCode;
				case 'BankCodeLabel':
					if (!$this->lblBankCode) return $this->lblBankCode_Create();
					return $this->lblBankCode;
				case 'AccountNameControl':
					if (!$this->txtAccountName) return $this->txtAccountName_Create();
					return $this->txtAccountName;
				case 'AccountNameLabel':
					if (!$this->lblAccountName) return $this->lblAccountName_Create();
					return $this->lblAccountName;
				case 'AccountIdControl':
					if (!$this->txtAccountId) return $this->txtAccountId_Create();
					return $this->txtAccountId;
				case 'AccountIdLabel':
					if (!$this->lblAccountId) return $this->lblAccountId_Create();
					return $this->lblAccountId;
				case 'AccountTypeControl':
					if (!$this->txtAccountType) return $this->txtAccountType_Create();
					return $this->txtAccountType;
				case 'AccountTypeLabel':
					if (!$this->lblAccountType) return $this->lblAccountType_Create();
					return $this->lblAccountType;
				case 'StatusControl':
					if (!$this->txtStatus) return $this->txtStatus_Create();
					return $this->txtStatus;
				case 'StatusLabel':
					if (!$this->lblStatus) return $this->lblStatus_Create();
					return $this->lblStatus;
				case 'ActiveControl':
					if (!$this->txtActive) return $this->txtActive_Create();
					return $this->txtActive;
				case 'ActiveLabel':
					if (!$this->lblActive) return $this->lblActive_Create();
					return $this->lblActive;
				case 'AuthCodeControl':
					if (!$this->txtAuthCode) return $this->txtAuthCode_Create();
					return $this->txtAuthCode;
				case 'AuthCodeLabel':
					if (!$this->lblAuthCode) return $this->lblAuthCode_Create();
					return $this->lblAuthCode;
				case 'AuthDateControl':
					if (!$this->calAuthDate) return $this->calAuthDate_Create();
					return $this->calAuthDate;
				case 'AuthDateLabel':
					if (!$this->lblAuthDate) return $this->lblAuthDate_Create();
					return $this->lblAuthDate;
				case 'CreateDateControl':
					if (!$this->calCreateDate) return $this->calCreateDate_Create();
					return $this->calCreateDate;
				case 'CreateDateLabel':
					if (!$this->lblCreateDate) return $this->lblCreateDate_Create();
					return $this->lblCreateDate;
				case 'AccountNameKanaControl':
					if (!$this->txtAccountNameKana) return $this->txtAccountNameKana_Create();
					return $this->txtAccountNameKana;
				case 'AccountNameKanaLabel':
					if (!$this->lblAccountNameKana) return $this->lblAccountNameKana_Create();
					return $this->lblAccountNameKana;
				case 'IpControl':
					if (!$this->txtIp) return $this->txtIp_Create();
					return $this->txtIp;
				case 'IpLabel':
					if (!$this->lblIp) return $this->lblIp_Create();
					return $this->lblIp;
				case 'TypeControl':
					if (!$this->txtType) return $this->txtType_Create();
					return $this->txtType;
				case 'TypeLabel':
					if (!$this->lblType) return $this->lblType_Create();
					return $this->lblType;
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

		/**
		 * Override method to perform a property "Set"
		 * This will set the property $strName to be $mixValue
		 *
		 * @param string $strName Name of the property to set
		 * @param string $mixValue New value of the property
		 * @return mixed
		 */
		public function __set($strName, $mixValue) {
			try {
				switch ($strName) {
					// Controls that point to TableBank fields
					case 'IdControl':
						return ($this->lblId = QType::Cast($mixValue, 'QControl'));
					case 'UserIdControl':
						return ($this->lstUser = QType::Cast($mixValue, 'QControl'));
					case 'CountryNameControl':
						return ($this->txtCountryName = QType::Cast($mixValue, 'QControl'));
					case 'CountryCodeControl':
						return ($this->txtCountryCode = QType::Cast($mixValue, 'QControl'));
					case 'BranchNameControl':
						return ($this->txtBranchName = QType::Cast($mixValue, 'QControl'));
					case 'BranchCodeControl':
						return ($this->txtBranchCode = QType::Cast($mixValue, 'QControl'));
					case 'BankNameControl':
						return ($this->txtBankName = QType::Cast($mixValue, 'QControl'));
					case 'BankCodeControl':
						return ($this->txtBankCode = QType::Cast($mixValue, 'QControl'));
					case 'AccountNameControl':
						return ($this->txtAccountName = QType::Cast($mixValue, 'QControl'));
					case 'AccountIdControl':
						return ($this->txtAccountId = QType::Cast($mixValue, 'QControl'));
					case 'AccountTypeControl':
						return ($this->txtAccountType = QType::Cast($mixValue, 'QControl'));
					case 'StatusControl':
						return ($this->txtStatus = QType::Cast($mixValue, 'QControl'));
					case 'ActiveControl':
						return ($this->txtActive = QType::Cast($mixValue, 'QControl'));
					case 'AuthCodeControl':
						return ($this->txtAuthCode = QType::Cast($mixValue, 'QControl'));
					case 'AuthDateControl':
						return ($this->calAuthDate = QType::Cast($mixValue, 'QControl'));
					case 'CreateDateControl':
						return ($this->calCreateDate = QType::Cast($mixValue, 'QControl'));
					case 'AccountNameKanaControl':
						return ($this->txtAccountNameKana = QType::Cast($mixValue, 'QControl'));
					case 'IpControl':
						return ($this->txtIp = QType::Cast($mixValue, 'QControl'));
					case 'TypeControl':
						return ($this->txtType = QType::Cast($mixValue, 'QControl'));
					default:
						return parent::__set($strName, $mixValue);
				}
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}
	}
?>